<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改会议安排')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-arrange-edit" th:object="${exposureArrange}">
            <h4 class="form-header h4">曝光信息</h4>
            <input name="arrangeId" th:field="*{arrangeId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">曝光标题：</label>
                <div class="col-sm-8">
                    <input name="arrangeName" th:field="*{arrangeTitle}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">会议主题：</label>
                <div class="col-sm-8">
                    <input name="arrangeTheme" th:field="*{arrangeTheme}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="startTime" th:value="${#dates.format(conferenceArrange.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="endTime" th:value="${#dates.format(conferenceArrange.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">填报截止时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="lastFullTime" th:value="${#dates.format(conferenceArrange.lastFullTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <label for="websiteTips" class="col-sm-3 control-label">站内提示：</label>
            <div id="websiteTips" class="col-sm-8">
                <div class="radio-inline">
                    <label><input type="radio" name="websiteTips" value="0" th:field="*{websiteTips}" readonly/>不提示</label>
                </div>
                <div class="radio-inline">
                    <label><input type="radio" name="websiteTips" value="1" th:field="*{websiteTips}" readonly/>提示</label>
                </div>
            </div>
            <label for="smsTips" class="col-sm-3 control-label">短信提醒：</label>
            <div id="smsTips" class="col-sm-8">
                <div class="radio-inline">
                    <label><input type="radio" name="smsTips" value="0" th:field="*{smsTips}" readonly/>不提示</label>
                </div>
                <div class="radio-inline">
                    <label><input type="radio" name="smsTips" value="1" th:field="*{smsTips}" readonly/>提示</label>
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">附件：</label>
                <div class="col-sm-8">
                    <input name="attachments" th:field="*{attachments}" class="form-control" type="text" readonly>
                    <div class="file-loading">
                        <input id="file-upload" name="file" class="form-control file-upload" type="file" multiple>
                    </div>
                </div>
            </div>
            <!--<label for="status" class="col-sm-3 control-label">工作状态：</label>
            <div id="status" class="col-sm-8">
                <div class="radio-inline">
                    <label><input type="radio" name="status" value="0" th:field="*{status}" readonly/>草稿</label>
                </div>
                <div class="radio-inline">
                    <label><input type="radio" name="status" value="1" th:field="*{status}" readonly/>已发布</label>
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label is-required">发起人ID：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人：</label>
                <div class="col-sm-8">
                    <input name="userName" th:field="*{userName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人部门ID：</label>
                <div class="col-sm-8">
                    <input name="deptId" th:field="*{deptId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发起人部门：</label>
                <div class="col-sm-8">
                    <input name="deptName" th:field="*{deptName}" class="form-control" type="text" required>
                </div>
            </div>-->
            <!--<h4 class="form-header h4">填报进度信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
                    <button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "conference/arrange";
        $("#form-arrange-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-arrange-edit').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='lastFullTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(function() {
            var options = {
                data: [[${conferenceArrange.conferenceProgressList}]],
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'arrangeName',
                    align: 'center',
                    title: '会议名称',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].arrangeName' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'receiveUserId',
                    align: 'center',
                    title: '接收人ID',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].receiveUserId' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'receiveUser',
                    align: 'center',
                    title: '接收人',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].receiveUser' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'receiveDeptId',
                    align: 'center',
                    title: '接收部门ID',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].receiveDeptId' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'receiveDept',
                    align: 'center',
                    title: '接收部门',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].receiveDept' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'receiveTime',
                    align: 'center',
                    title: '接收时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].receiveTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'lastFullTime',
                    align: 'center',
                    title: '填报截止时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].lastFullTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'status',
                    align: 'center',
                    title: '工作状态',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].status' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'createBy',
                    align: 'center',
                    title: '创建者',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].createBy' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'createTime',
                    align: 'center',
                    title: '创建时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].createTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'updateBy',
                    align: 'center',
                    title: '更新者',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].updateBy' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'updateTime',
                    align: 'center',
                    title: '更新时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].updateTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'remark',
                    align: 'center',
                    title: '备注',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].remark' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'userId',
                    align: 'center',
                    title: '发起人ID',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].userId' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'userName',
                    align: 'center',
                    title: '发起人',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].userName' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'deptId',
                    align: 'center',
                    title: '发起人部门ID',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].deptId' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'deptName',
                    align: 'center',
                    title: '发起人部门',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='conferenceProgressList[%s].deptName' value='%s'>", index, value);
                        return html;
                    }
				
                }]
            };
            $.table.init(options);
        });

        function addColumn() {
            var count = $("#" + table.options.id).bootstrapTable('getData').length;
            sub.editColumn();
        	
            $("#" + table.options.id).bootstrapTable('insertRow', {
                index: count,
                row: {
                    index: $.table.serialNumber(count),
                    arrangeName: "",
                    receiveUserId: "",
                    receiveUser: "",
                    receiveDeptId: "",
                    receiveDept: "",
                    receiveTime: "",
                    lastFullTime: "",
                    status: "",
                    createBy: "",
                    createTime: "",
                    updateBy: "",
                    updateTime: "",
                    remark: "",
                    userId: "",
                    userName: "",
                    deptId: "",
                    deptName: ""
        	    }
            });
        }

        // 附件上传初始化
        $(function(){
            initUploadFileInfo("attachments", "file-upload", [], "");
        })
    </script>
</body>
</html>